<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Add Gallery</title>
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/js/fullhappy.cookie.js"></script>
<script type="text/javascript" src="/js/lightbox/lightBox.js"></script>
<script type="text/javascript" src="/js/lightbox/lightBox.js"></script>
<script type="text/javascript" src="/js/sessvars.js"></script>
<script type="text/javascript" src="/js/admin.call.rest.action.js"></script>
</head>
<body style="width: 230px; height:40px; margin: 0 ;text-align: center;">
	<form>
		<input style="width: 150px;" id="new_category_name" type="text"
			placeholder="" />
		<input type="button" onclick="editCategory();"
			value="save"/>
	</form>
	<script type="text/javascript">		
		//$('input[type = "text"]').attr('placeholder',window.location.search.substr(1).split('&')[1]);
		$('input[type = "text"]').attr('value',window.location.search.substr(1).split('&')[1]);
		function editCategory(){
			var newCategoryName = document.getElementById('new_category_name').value;
			newCategoryName = newCategoryName.trim();
			if(newCategoryName.length<=0){
				return false;
			}else{			 
				var categoryId = window.location.search.substr(1).split('&')[0];
				AdminCallRestAction.editCategory(categoryId, newCategoryName,
						function(){
					alert(sessvars.editNode);
							(new HappyLightBox()).innerClose(); 
							
						});	  
			}
				
		};
	</script>
</body>
</html>